*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,'Microsoft YaHei',sans-serif;background:#fff;color:#222}
.app{display:flex;height:100vh;}

.sidebar{width:260px;border-right:1px solid #eee;padding:12px;display:flex;flex-direction:column;gap:10px;background:#fafafa}
.brand{font-weight:700;font-size:18px;margin-bottom:8px}
.session-list{flex:1;overflow:auto;border-top:1px solid #eee;padding-top:8px}
.session-item{padding:10px;border-radius:10px;margin-bottom:6px;cursor:pointer;border:1px solid #eee;background:#fff}
.session-item.active{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.12)}

.main{flex:1;display:flex;flex-direction:column}
.header{height:44px;border-bottom:1px solid #eee;padding:10px 16px;display:flex;align-items:center;gap:12px;background:#fff;position:sticky;top:0}
.messages{flex:1;overflow:auto;padding:20px;background:#fff}
.msg{max-width:880px;margin:0 auto 14px;padding:14px 16px;border-radius:16px;border:1px solid #eee;line-height:1.6;white-space:pre-wrap;word-break:break-word}
.msg.user{background:#f1f5f9}
.msg.assistant{background:#ffffff}
.msg.assistant.streaming{border-style:dashed}

.composer{border-top:1px solid #eee;padding:10px 14px;display:flex;gap:10px;background:#fff}
#prompt{flex:1;height:80px;resize:none;padding:12px;border-radius:12px;border:1px solid #ddd;outline:none}
#prompt:focus{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.12)}
#send{padding:0 16px;border-radius:12px;border:1px solid #2563eb;background:#2563eb;color:#fff;cursor:pointer}
#send:disabled{opacity:.5;cursor:not-allowed}